package cc.rengu.igas.bsps.common.enums;

/**
 * 二维码状态枚举
 * Created by 王成 on 2018/7/11.
 */
public enum QrStatusEnum {
    NORMAL("00", "可用"),
    ABNORMAL("01", "不可用"),
    STOP("02", "暂停"),
    CANCEL("03", "注销");
    private String status;
    private String desc;

    QrStatusEnum(String status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String changeQrCodeStatus(String oprType) {
        switch (oprType) {
            case "01":
                return STOP.getStatus();
            case "02":
                return NORMAL.getStatus();
            case "03":
                return CANCEL.getStatus();
            default:
                return null;
        }
    }
}
